package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.PurchaseOrder;
import com.ruoyi.system.domain.Supplier;
import com.ruoyi.system.mapper.SupplierMapper;
import com.ruoyi.system.service.ISupplierSerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SupplierServiceImpl implements ISupplierSerService {
    @Autowired
    private SupplierMapper supplierMapper;

    @Override
    public List<Supplier> selectSupplierList(Supplier supplier) {
        List<Supplier> list=supplierMapper.selectSupplierList(supplier);
        return list;
    }

    @Override
    public Supplier selectSupplierById(Long supplierId) {
        Supplier supplier=supplierMapper.selectSupplierById(supplierId);
        return supplier;
    }

    @Override
    public List<PurchaseOrder> selectSalesOrdersBySupplierId(Long supplierId) {
        List<PurchaseOrder> list=supplierMapper.selectPurchaseOrdersBySupplierId(supplierId);
        return list;
    }

    @Override
    public int insertSupplier(Supplier supplier) {
        int num=supplierMapper.insertSupplier(supplier);
        return num;
    }

    @Override
    public int updateSupplier(Supplier supplier) {
        int num=supplierMapper.updateSupplier(supplier);
        return num;
    }

    @Override
    public int deleteSupplierById(Long supplierId) {
        int num=supplierMapper.deleteSupplierById(supplierId);
        return num;
    }

    @Override
    public int deleteSupplierByIds(Long[] supplierIds) {
        int num=supplierMapper.deleteSupplierByIds(supplierIds);
        return num;
    }
}
